package com.bw.mvvm_common.mvvm.network.inteceptor;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

public
/**
 * @author Lishaohe
 * @description:
 * @date :2021/10/13 0013 下午 4:25
 *
 */
class Errolnterceptor implements Interceptor {
    @Override
    public Response intercept(Chain chain) throws IOException {
        Request request = chain.request();
        Response response = chain.proceed(request);
        if (response.code()==200){
            return response;
        }
        Response.Builder builder = new Response.Builder();
        builder.code(200);
        builder.headers(response.headers());
        builder.message(response.message());
        builder.protocol(response.protocol());
        builder.body(response.body());
        return builder.build();
    }
}
